/*
 * @Author: szx
 * @Date: 2022-06-04 10:31:43
 * @LastEditTime: 2022-06-04 10:38:24
 * @Description:
 * @FilePath: \leetcode\900-999\929\929.js
 */
/**
 * @param {string[]} emails
 * @return {number}
 */
var numUniqueEmails = function (emails) {
    const set = new Set();
    for (let email of emails) {
        const arr = email.split('@');
        let res = '';

        for (let i = 0; i < arr[0].length; i++) {
            if (arr[0][i] == '.') continue;
            if (arr[0][i] == '+') break;
            res += arr[0][i];
        }
        set.add(res + '@' + arr[1]);
    }
    return set.size;
};
